﻿using System.ComponentModel.DataAnnotations.Schema;
using Microsoft.AspNetCore.DataProtection.KeyManagement;

namespace K9Nano.Domain.Entities;

public abstract class AuditEntityBase : IAuditEntity
{
    [Column(Order = 0)]
    public long Id { get; set; }

    [Column(Order = 1000)]
    public long CreatedBy { get; set; }

    [Column(Order = 1010)]
    public DateTime CreatedAt { get; set; }

    [Column(Order = 1020)]
    public long? UpdatedBy { get; set; }

    [Column(Order = 1030)]
    public DateTime? UpdatedAt { get; set; }

    public virtual bool IsTransient() => Id.Equals(default);
}